-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: graysonwu <wgrayson@vmware.com>
- Loading branch information
Showing
13 changed files
with
2,312 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192 changes: 192 additions & 0 deletions
192
api/infra/domains/groups/policy_firewall_flood_protection_profile_binding_map.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
//nolint:revive | ||
package groups | ||
|
||
// The following file has been autogenerated. Please avoid any changes! | ||
import ( | ||
"errors" | ||
|
||
vapiProtocolClient_ "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" | ||
client1 "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/groups" | ||
model1 "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" | ||
client0 "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/domains/groups" | ||
model0 "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" | ||
client2 "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/orgs/projects/infra/domains/groups" | ||
|
||
utl "github.com/vmware/terraform-provider-nsxt/api/utl" | ||
) | ||
|
||
type PolicyFirewallFloodProtectionProfileBindingMapClientContext utl.ClientContext | ||
|
||
func NewFirewallFloodProtectionProfileBindingMapsClient(sessionContext utl.SessionContext, connector vapiProtocolClient_.Connector) *PolicyFirewallFloodProtectionProfileBindingMapClientContext { | ||
var client interface{} | ||
|
||
switch sessionContext.ClientType { | ||
|
||
case utl.Local: | ||
client = client0.NewFirewallFloodProtectionProfileBindingMapsClient(connector) | ||
|
||
case utl.Global: | ||
client = client1.NewFirewallFloodProtectionProfileBindingMapsClient(connector) | ||
|
||
case utl.Multitenancy: | ||
client = client2.NewFirewallFloodProtectionProfileBindingMapsClient(connector) | ||
|
||
default: | ||
return nil | ||
} | ||
return &PolicyFirewallFloodProtectionProfileBindingMapClientContext{Client: client, ClientType: sessionContext.ClientType, ProjectID: sessionContext.ProjectID} | ||
} | ||
|
||
func (c PolicyFirewallFloodProtectionProfileBindingMapClientContext) Get(domainIdParam string, groupIdParam string, firewallFloodProtectionProfileBindingMapIdParam string) (model0.PolicyFirewallFloodProtectionProfileBindingMap, error) { | ||
var obj model0.PolicyFirewallFloodProtectionProfileBindingMap | ||
var err error | ||
|
||
switch c.ClientType { | ||
|
||
case utl.Local: | ||
client := c.Client.(client0.FirewallFloodProtectionProfileBindingMapsClient) | ||
obj, err = client.Get(domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam) | ||
if err != nil { | ||
return obj, err | ||
} | ||
|
||
case utl.Global: | ||
client := c.Client.(client1.FirewallFloodProtectionProfileBindingMapsClient) | ||
gmObj, err1 := client.Get(domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam) | ||
if err1 != nil { | ||
return obj, err1 | ||
} | ||
var rawObj interface{} | ||
rawObj, err = utl.ConvertModelBindingType(gmObj, model1.PolicyFirewallFloodProtectionProfileBindingMapBindingType(), model0.PolicyFirewallFloodProtectionProfileBindingMapBindingType()) | ||
obj = rawObj.(model0.PolicyFirewallFloodProtectionProfileBindingMap) | ||
|
||
case utl.Multitenancy: | ||
client := c.Client.(client2.FirewallFloodProtectionProfileBindingMapsClient) | ||
obj, err = client.Get(utl.DefaultOrgID, c.ProjectID, domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam) | ||
if err != nil { | ||
return obj, err | ||
} | ||
|
||
default: | ||
return obj, errors.New("invalid infrastructure for model") | ||
} | ||
return obj, err | ||
} | ||
|
||
func (c PolicyFirewallFloodProtectionProfileBindingMapClientContext) Delete(domainIdParam string, groupIdParam string, firewallFloodProtectionProfileBindingMapIdParam string) error { | ||
var err error | ||
|
||
switch c.ClientType { | ||
|
||
case utl.Local: | ||
client := c.Client.(client0.FirewallFloodProtectionProfileBindingMapsClient) | ||
err = client.Delete(domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam) | ||
|
||
case utl.Global: | ||
client := c.Client.(client1.FirewallFloodProtectionProfileBindingMapsClient) | ||
err = client.Delete(domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam) | ||
|
||
case utl.Multitenancy: | ||
client := c.Client.(client2.FirewallFloodProtectionProfileBindingMapsClient) | ||
err = client.Delete(utl.DefaultOrgID, c.ProjectID, domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam) | ||
|
||
default: | ||
err = errors.New("invalid infrastructure for model") | ||
} | ||
return err | ||
} | ||
|
||
func (c PolicyFirewallFloodProtectionProfileBindingMapClientContext) Patch(domainIdParam string, groupIdParam string, firewallFloodProtectionProfileBindingMapIdParam string, policyFirewallFloodProtectionProfileBindingMapParam model0.PolicyFirewallFloodProtectionProfileBindingMap) error { | ||
var err error | ||
|
||
switch c.ClientType { | ||
|
||
case utl.Local: | ||
client := c.Client.(client0.FirewallFloodProtectionProfileBindingMapsClient) | ||
err = client.Patch(domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam, policyFirewallFloodProtectionProfileBindingMapParam) | ||
|
||
case utl.Global: | ||
client := c.Client.(client1.FirewallFloodProtectionProfileBindingMapsClient) | ||
gmObj, err1 := utl.ConvertModelBindingType(policyFirewallFloodProtectionProfileBindingMapParam, model0.PolicyFirewallFloodProtectionProfileBindingMapBindingType(), model1.PolicyFirewallFloodProtectionProfileBindingMapBindingType()) | ||
if err1 != nil { | ||
return err1 | ||
} | ||
err = client.Patch(domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam, gmObj.(model1.PolicyFirewallFloodProtectionProfileBindingMap)) | ||
|
||
case utl.Multitenancy: | ||
client := c.Client.(client2.FirewallFloodProtectionProfileBindingMapsClient) | ||
err = client.Patch(utl.DefaultOrgID, c.ProjectID, domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam, policyFirewallFloodProtectionProfileBindingMapParam) | ||
|
||
default: | ||
err = errors.New("invalid infrastructure for model") | ||
} | ||
return err | ||
} | ||
|
||
func (c PolicyFirewallFloodProtectionProfileBindingMapClientContext) Update(domainIdParam string, groupIdParam string, firewallFloodProtectionProfileBindingMapIdParam string, policyFirewallFloodProtectionProfileBindingMapParam model0.PolicyFirewallFloodProtectionProfileBindingMap) (model0.PolicyFirewallFloodProtectionProfileBindingMap, error) { | ||
var err error | ||
var obj model0.PolicyFirewallFloodProtectionProfileBindingMap | ||
|
||
switch c.ClientType { | ||
|
||
case utl.Local: | ||
client := c.Client.(client0.FirewallFloodProtectionProfileBindingMapsClient) | ||
obj, err = client.Update(domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam, policyFirewallFloodProtectionProfileBindingMapParam) | ||
|
||
case utl.Global: | ||
client := c.Client.(client1.FirewallFloodProtectionProfileBindingMapsClient) | ||
gmObj, err := utl.ConvertModelBindingType(policyFirewallFloodProtectionProfileBindingMapParam, model0.PolicyFirewallFloodProtectionProfileBindingMapBindingType(), model1.PolicyFirewallFloodProtectionProfileBindingMapBindingType()) | ||
if err != nil { | ||
return obj, err | ||
} | ||
gmObj, err = client.Update(domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam, gmObj.(model1.PolicyFirewallFloodProtectionProfileBindingMap)) | ||
if err != nil { | ||
return obj, err | ||
} | ||
obj1, err1 := utl.ConvertModelBindingType(gmObj, model1.PolicyFirewallFloodProtectionProfileBindingMapBindingType(), model0.PolicyFirewallFloodProtectionProfileBindingMapBindingType()) | ||
if err1 != nil { | ||
return obj, err1 | ||
} | ||
obj = obj1.(model0.PolicyFirewallFloodProtectionProfileBindingMap) | ||
|
||
case utl.Multitenancy: | ||
client := c.Client.(client2.FirewallFloodProtectionProfileBindingMapsClient) | ||
obj, err = client.Update(utl.DefaultOrgID, c.ProjectID, domainIdParam, groupIdParam, firewallFloodProtectionProfileBindingMapIdParam, policyFirewallFloodProtectionProfileBindingMapParam) | ||
|
||
default: | ||
err = errors.New("invalid infrastructure for model") | ||
} | ||
return obj, err | ||
} | ||
|
||
func (c PolicyFirewallFloodProtectionProfileBindingMapClientContext) List(domainIdParam string, groupIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model0.PolicyFirewallFloodProtectionProfileBindingMapListResult, error) { | ||
var err error | ||
var obj model0.PolicyFirewallFloodProtectionProfileBindingMapListResult | ||
|
||
switch c.ClientType { | ||
|
||
case utl.Local: | ||
client := c.Client.(client0.FirewallFloodProtectionProfileBindingMapsClient) | ||
obj, err = client.List(domainIdParam, groupIdParam, cursorParam, includeMarkForDeleteObjectsParam, includedFieldsParam, pageSizeParam, sortAscendingParam, sortByParam) | ||
|
||
case utl.Global: | ||
client := c.Client.(client1.FirewallFloodProtectionProfileBindingMapsClient) | ||
gmObj, err := client.List(domainIdParam, groupIdParam, cursorParam, includeMarkForDeleteObjectsParam, includedFieldsParam, pageSizeParam, sortAscendingParam, sortByParam) | ||
if err != nil { | ||
return obj, err | ||
} | ||
obj1, err1 := utl.ConvertModelBindingType(gmObj, model1.PolicyFirewallFloodProtectionProfileBindingMapListResultBindingType(), model0.PolicyFirewallFloodProtectionProfileBindingMapListResultBindingType()) | ||
if err1 != nil { | ||
return obj, err1 | ||
} | ||
obj = obj1.(model0.PolicyFirewallFloodProtectionProfileBindingMapListResult) | ||
|
||
case utl.Multitenancy: | ||
client := c.Client.(client2.FirewallFloodProtectionProfileBindingMapsClient) | ||
obj, err = client.List(utl.DefaultOrgID, c.ProjectID, domainIdParam, groupIdParam, cursorParam, includeMarkForDeleteObjectsParam, includedFieldsParam, pageSizeParam, sortAscendingParam, sortByParam) | ||
|
||
default: | ||
err = errors.New("invalid infrastructure for model") | ||
} | ||
return obj, err | ||
} |
Oops, something went wrong.